﻿using log4net;
using log4net.Config;
using log4net.Repository;
using RosSharp;
using RosSharp.rosgraph_msgs;
using RosSharp.Slave;
using RosSharp.Utility;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reactive.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace RosTest
{
    class Program
    {
        static void Main(string[] args)
        {
            LogHelper.Init(AppDomain.CurrentDomain.BaseDirectory + "log4net.config");

            Ros.MasterUri = new Uri("http://192.168.20.132:11311");
            Ros.HostName = "192.168.20.1";
            Ros.TopicTimeout = 50000;
            Ros.XmlRpcTimeout = 50000;

            var node = Ros.InitNodeAsync("/aaa").Result;
            var subscriber = node.SubscriberAsync<RosSharp.std_msgs.String>("/chatter").Result;
            subscriber.Subscribe(x => Console.WriteLine(x.data));

        }
    }
}
